package com.jhyspringcloud.order.controller;


import com.jhyspringcloud.config.pojo.dto.OrderDto;
import com.jhyspringcloud.order.service.OrderService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/order")
public class OrderHomeController {

    @Resource
    OrderService orderService;

    @RequestMapping("test")
    public String test(){
        return "success";
    }


    @RequestMapping("/{id}")
    public OrderDto findOrderById(@PathVariable("id") Long id){
        return orderService.findOrderById(id);

    }

}
